package com.woniuxy.tfss.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.tfss.entity.Comment;
import com.woniuxy.tfss.mapper.CommentMapper;
import com.woniuxy.tfss.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> implements CommentService {
    @Autowired
    CommentMapper commentMapper;

    /**
     * 根据订单id查询评论
     *
     * @param orderId
     * @return
     */
    @Override
    public Comment getByOrderId(Integer orderId) {
        return commentMapper.getByOrderId(orderId);
    }

    /**
     * 根据骑手id查询该骑手的评价
     *
     * @param riderId
     * @return
     */
    @Override
    public List<Comment> getByRiderId(Integer riderId) {
        return commentMapper.getByRiderId(riderId);
    }
}
